﻿import QtQuick 2.0
import QtQuick.Layouts 1.12
import QtQuick.Window 2.12
import "../components"
Window {


    id: root
    title: "高级搜索"

    modality: Qt.WindowModal
    flags: Qt.Window | Qt.WindowTitleHint |Qt.WindowSystemMenuHint | Qt.WindowCloseButtonHint
    // 固定尺寸
    maximumHeight: 420*dp
    minimumHeight: 420*dp
    maximumWidth: 648*dp
    minimumWidth: 648*dp

    signal accept()
    signal reject()


    property string res_expName     : ""
    property string res_equName     : ""
    property string res_programName : ""
    property string res_kit         : ""
    property string res_code        : ""
    property string res_sampleName  : ""
    property string res_consume     : ""
    property string res_system      : ""
    property string res_createTime1 : ""
    property string res_createTime2 : ""


    Column{
        y: 40*dp
        x: 55*dp
        spacing: 20*dp
        width: parent.width - 110*dp
        Row{                            // 上半边 =========================
            spacing: 20*dp
            LineEditor{
                title: "实验名称"
                id: edit_expName
                prompt: "全部"
            }
            LineEditor{
                title: "设备名称"
                id: edit_equName
                prompt: "全部"
            }
        }Row{
            spacing: 20*dp
            LineEditor{
                title: "扩增程序"
                id: edit_program
                prompt: "全部"
            }LineEditor{
                title: "试  剂  盒"
                id: edit_kit
                prompt: "全部"
            }
        }Row{                           // 下半边 =========================
            spacing: 20*dp
            LineEditor{
                title: "编码"
                id: edit_code
                prompt: "全部"
            }LineEditor{
                title: "样本名称"
                id: edit_sampleName

                prompt: "全部"
            }
        }Row{
            spacing: 20*dp
            LineEditor{
                title: "耗材"
                id: edit_consume
                prompt: "全部"
            }LineEditor{
                title: "体系(μl)"
                id: edit_system
                prompt: "全部"
            }
        }
        Row{
            spacing: 20*dp
            LineEditor{
                title: "创建时间"
                id: edit_createTime1
                prompt: "1900-01-01"
            }
            LineEditor{
                id: edit_createTime2
                title: "     —"
                prompt: "2100-12-31"
            }
        }
    }
    Item{
        y: parent.height - 80*dp
        width: root.width
        height: 40*dp
        CustomHorSpacerItem{}
        PushButton{
            title: "取消"
            x: root.width/2 - 128*dp
            defaultMode2: true
            onReleased: {
                root.reject()
                root.close()
            }
        }PushButton{
            x: root.width/2 + 8*dp
            title: "确定"
            defaultMode1: true
            onReleased: {

                res_expName     = edit_expName.getText()
                res_equName     = edit_equName.getText()
                res_programName = edit_program.getText()
                res_kit         = edit_kit.getText()

                res_code        = edit_code.getText()
                res_sampleName  = edit_sampleName.getText()
                res_consume     = edit_consume.getText()
                res_system      = edit_system.getText()

                res_createTime1 = edit_createTime1.getText()
                res_createTime2 = edit_createTime2.getText()

                root.accept()
                root.close()
            }
        }PushButton{
            title: "重置"
            height: 20*dp;  width: 50*dp
            x: root.width/2 + 135*dp; y: 10*dp
            text_color: "#1677FF"
            onReleased: {
                edit_equName.setText("")
                edit_expName.setText("")
                edit_program.setText("")
                edit_kit.setText("")

                edit_code.setText("")
                edit_sampleName.setText("")
                edit_consume.setText("")
                edit_system.setText("")

                edit_createTime1.setText("")
                edit_createTime2.setText("")

            }
        }

        CustomHorSpacerItem{}
    }

}
